﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace pufflesweb.admin
{
    public partial class Aadoptcheck : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string TID = Request.QueryString["TID"];

                PModel.Adopt adopt = PBLL.Adopt.Getuser(int.Parse(TID));

                this.tchecktext.Text = adopt.Tchecktext;
                this.tcheck.Text = adopt.Tcheck.ToString();
                this.HiddenField1.Value = adopt.TID.ToString();
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            PModel.Adopt adopt = new PModel.Adopt();
            adopt.TID = int.Parse(this.HiddenField1.Value);
            adopt.Tcheck = int.Parse(this.tcheck.Text);
            adopt.Tchecktext= this.tchecktext.Text;

            if (PBLL.Adopt.Check(adopt))
            {
                PF.JsHelper.AlertAndParentUrl("修改保存成功", "main.aspx");
            }
            else
            {
                PF.JsHelper.AlertAndParentUrl("修改失败,请重新输入", "Aapplycheck.aspx");
            }
        }
    }
}